overlay: add setters and getters for pass-through child property
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 16 Jun 2015 19:01:30 +0000 (12:01 -0700)
committerCosimo Cecchi <cosimoc@gnome.org>
Wed, 17 Jun 2015 18:48:37 +0000 (11:48 -0700)
This will make the API easier to use from bindings too.

https://bugzilla.gnome.org/show_bug.cgi?id=750568

docs/reference/gtk/gtk3-sections.txt
gtk/gtkoverlay.c
gtk/gtkoverlay.h

index dd9cdf66ed04784102a01435960fec4295ef177a..effa865b0b071cdb6dd8e0ad17223a89b038ffce 100644 (file)
@@ -7775,6 +7775,8 @@ gtk_overlay_new
 gtk_overlay_add_overlay
 gtk_overlay_add_pass_through_overlay
 gtk_overlay_reorder_overlay
+gtk_overlay_get_overlay_pass_through
+gtk_overlay_set_overlay_pass_through
 
 <SUBSECTION Standard>
 GTK_TYPE_OVERLAY
index eb6ac04177fb2d3f332f60cf59df3b236a88df39..efe85572dcec74375805c2532cf078ed93b6595a 100644 (file)
@@ -897,6 +897,58 @@ gtk_overlay_add_overlay (GtkOverlay *overlay,
   gtk_widget_child_notify (widget, "index");
 }
 
+/**
+ * gtk_overlay_set_overlay_pass_through:
+ * @overlay: a #GtkOverlay
+ * @widget: an overlay child of #GtkOverlay
+ * @pass_through: whether the child should pass the input through
+ *
+ * Convenience function to set the value of the #GtkOverlay:pass-through
+ * child property for @widget.
+ *
+ * Since: 3.18
+ */
+void
+gtk_overlay_set_overlay_pass_through (GtkOverlay *overlay,
+                                     GtkWidget  *widget,
+                                     gboolean    pass_through)
+{
+  g_return_if_fail (GTK_IS_OVERLAY (overlay));
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  gtk_container_child_set (GTK_CONTAINER (overlay), widget,
+                          "pass-through", pass_through,
+                          NULL);
+}
+
+/**
+ * gtk_overlay_get_overlay_pass_through:
+ * @overlay: a #GtkOverlay
+ * @widget: an overlay child of #GtkOverlay
+ *
+ * Convenience function to get the value of the #GtkOverlay:pass-through
+ * child property for @widget.
+ *
+ * Returns: whether the widget is a pass through child.
+ *
+ * Since: 3.18
+ */
+gboolean
+gtk_overlay_get_overlay_pass_through (GtkOverlay *overlay,
+                                     GtkWidget  *widget)
+{
+  gboolean pass_through;
+
+  g_return_val_if_fail (GTK_IS_OVERLAY (overlay), FALSE);
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+
+  gtk_container_child_get (GTK_CONTAINER (overlay), widget,
+                          "pass-through", &pass_through,
+                          NULL);
+
+  return pass_through;
+}
+
 /**
  * gtk_overlay_add_pass_through_overlay:
  * @overlay: a #GtkOverlay
index 5055f2f2a0c338f2fd41ef38ad1d1f3e091785e1..95700f974e98138dfbd5274adbf8fbc31f191e62 100644 (file)
@@ -90,7 +90,13 @@ GDK_AVAILABLE_IN_3_18
 void       gtk_overlay_reorder_overlay (GtkOverlay     *overlay,
                                        GtkWidget      *child,
                                        gint            position);
-
+GDK_AVAILABLE_IN_3_18
+gboolean   gtk_overlay_get_overlay_pass_through (GtkOverlay *overlay,
+                                                GtkWidget  *widget);
+GDK_AVAILABLE_IN_3_18
+void       gtk_overlay_set_overlay_pass_through (GtkOverlay *overlay,
+                                                GtkWidget  *widget,
+                                                gboolean    pass_through);
 
 G_END_DECLS